<div class="row">
<div class="large-12 columns">
<?=$system_message;?>
<?if($edit_grade):?>
	<h5>Input Student Remarks <span style="font-size:11px;border:1px solid #000;padding:5px;">Toggle Edit on/off <input type="checkbox" id="grades"></span></h5>	
<?endif;?>
	<table>
		<thead>
			<tr>
				<td>Student Name</td>
				<?if($gp):?>
					<?foreach($gp as $k => $v):?>
						<td><?=ucwords($v->gp_desc);?></td>
					<?endforeach;?>
				<?else:?>
					<td colspan="4">-- No Grading Period --</td>
				<?endif;?>
			</tr>
		</thead>
		<tbody>


			<?if($student_grades_table):?>
				<?foreach($student_grades_table as $k => $v):?>
				<tr>
					<td><strong><?=ucwords($v['student_name']);?></strong></td>
					<?if($v['subject']):?>
						<noscript>
							<?=form_open();?>
						</noscript>
						<?foreach($v['remarks'] as $kk => $vv):?>
							<td width="<?=100/count($gp)?>%" >
								<p><?=trim(html_entity_decode($vv->remarks));?></p>
							</td>							
						<?endforeach;?>
					<?else:?>
					<td colspan="5">No Remarks</td>
					<?endif?>
				</tr>
				<?endforeach;?>
			<?else:?>
				<tr>
					<td colspan="5">No Students</td>
				</tr>
			<?endif;?>
		</tbody>
	</table>
	</div>
</div>
<span id="load" url="<?=image_url('load.gif');?>"></span>
<script src="<?=script_url('custom/grades');?>" type="text/javascript"></script>

<script>
	$(document).ready(function(){
		$(document).find('input[type=text]').attr('disabled','disabled');
		$(document).find('textarea').attr('disabled','disabled');

		$( "input[type=checkbox]#remarks" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('textarea.remarks').removeAttr('disabled');
			}else{
				$(document).find('textarea.remarks').attr('disabled','disabled');
			}
		});

		$( "input[type=checkbox]#attendance" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('input[type=text].attendance').removeAttr('disabled');
			}else{
				$(document).find('input[type=text].attendance').attr('disabled','disabled');
			}
		});

		$( "input[type=checkbox]#grades" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('input[type=text].grades').removeAttr('disabled');
			}else{
				$(document).find('input[type=text].grades').attr('disabled','disabled');
			}
		});
	});
</script>